<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="../vue.js"></script>
    <title>Document</title>
    <style>
      .box1 {
        width: 300px;
        height: 300px;
        background-color: pink;
      }
      .box2 {
        width: 100px;
        height: 100px;
        background-color: skyblue;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <input
        type="text"
        placeholder="按下回车提示输入"
        @keyup.enter="enterHandler"
      />
      <img :src="url" alt="" />
    </div>

    <script>
      Vue.config.productionTip = false; //阻止vue启动时生成的生产提示
      const vm = new Vue({
        el: "#app",
        data: {
          url: "dasiodhoa",
        },
        methods: {
          enterHandler() {
            console.log("回车按下了,校验之后提交给后台");
          },
        },
      });
    </script>
  </body>
</html>
